/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Worker {

    // 私有化
    private String name;
    private int age;

    // 对外提供的修改方法
    public void setName(String name) {      // 就近原则
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public void show() {
        System.out.println("大家好，我叫【" + name + "】，今年【" + age + "】岁");
    }
}
